class homeModel {
  List<Thumbnails> thumbnails;
  List<Services> services;
  List<Plans> plans;
  List<Packages> packages;
  List<Devices> devices;
  int storeOpen;
  int hasNotification;
  int tasks;
  String staff;
  List<Diagnosis> diagnosis;
  Qscc qscc;

  homeModel(
      {this.thumbnails,
      this.services,
      this.plans,
      this.packages,
      this.devices,
      this.storeOpen,
      this.hasNotification,
      this.tasks,
      this.staff,
      this.diagnosis,
      this.qscc});

  homeModel.fromJson(Map<String, dynamic> json) {
    if (json['thumbnails'] != null) {
      thumbnails = new List<Thumbnails>();
      json['thumbnails'].forEach((v) {
        thumbnails.add(new Thumbnails.fromJson(v));
      });
    }
    if (json['services'] != null) {
      services = new List<Services>();
      json['services'].forEach((v) {
        services.add(new Services.fromJson(v));
      });
    }
    if (json['plans'] != null) {
      plans = new List<Plans>();
      json['plans'].forEach((v) {
        plans.add(new Plans.fromJson(v));
      });
    }
    if (json['packages'] != null) {
      packages = new List<Packages>();
      json['packages'].forEach((v) {
        packages.add(new Packages.fromJson(v));
      });
    }
    if (json['devices'] != null) {
      devices = new List<Devices>();
      json['devices'].forEach((v) {
        devices.add(new Devices.fromJson(v));
      });
    }
    storeOpen = json['store_open'];
    hasNotification = json['has_notification'];
    tasks = json['tasks'];
    staff = json['staff'];
    if (json['diagnosis'] != null) {
      diagnosis = new List<Diagnosis>();
      json['diagnosis'].forEach((v) {
        diagnosis.add(new Diagnosis.fromJson(v));
      });
    }
    qscc = json['qscc'] != null ? new Qscc.fromJson(json['qscc']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.thumbnails != null) {
      data['thumbnails'] = this.thumbnails.map((v) => v.toJson()).toList();
    }
    if (this.services != null) {
      data['services'] = this.services.map((v) => v.toJson()).toList();
    }
    if (this.plans != null) {
      data['plans'] = this.plans.map((v) => v.toJson()).toList();
    }
    if (this.packages != null) {
      data['packages'] = this.packages.map((v) => v.toJson()).toList();
    }
    if (this.devices != null) {
      data['devices'] = this.devices.map((v) => v.toJson()).toList();
    }
    data['store_open'] = this.storeOpen;
    data['has_notification'] = this.hasNotification;
    data['tasks'] = this.tasks;
    data['staff'] = this.staff;
    if (this.diagnosis != null) {
      data['diagnosis'] = this.diagnosis.map((v) => v.toJson()).toList();
    }
    if (this.qscc != null) {
      data['qscc'] = this.qscc.toJson();
    }
    return data;
  }
}

class Thumbnails {
  int id;
  String url;
  int link;
  String type;

  Thumbnails({this.id, this.url, this.link, this.type});

  Thumbnails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    url = json['url'];
    link = json['link'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['url'] = this.url;
    data['link'] = this.link;
    data['type'] = this.type;
    return data;
  }
}

class Services {
  int id;
  String title;
  String thumbnail;
  String url;
  String serviceType;
  bool isPublish;
  List details;
  int index;

  Services(
      {this.id,
      this.title,
      this.thumbnail,
      this.url,
      this.serviceType,
      this.isPublish,
      this.details,
      this.index});

  Services.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    thumbnail = json['thumbnail'];
    url = json['url'];
    serviceType = json['service_type'];
    isPublish = json['is_publish'];
    details = json['details'];
    index = json['index'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['thumbnail'] = this.thumbnail;
    data['url'] = this.url;
    data['service_type'] = this.serviceType;
    data['is_publish'] = this.isPublish;
    if (this.details != null) {
      data['details'] = this.details.map((v) => v.toJson()).toList();
    }
    data['index'] = this.index;
    return data;
  }
}

class Plans {
  int id;
  String title;
  String thumbnail;
  String url;
  String shareUrl;
  String price;
  int order;
  String desc;
  String balance;
  int duration;
  String target;
  int willReplace;
  String type;

  Plans(
      {this.id,
      this.title,
      this.thumbnail,
      this.url,
      this.shareUrl,
      this.price,
      this.order,
      this.desc,
      this.balance,
      this.duration,
      this.target,
      this.willReplace,
      this.type});

  Plans.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    thumbnail = json['thumbnail'];
    url = json['url'];
    shareUrl = json['share_url'];
    price = json['price'].toString();
    order = json['order'];
    desc = json['desc'];
    balance = json['balance'];
    duration = json['duration'];
    target = json['target'];
    willReplace = json['will_replace'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['thumbnail'] = this.thumbnail;
    data['url'] = this.url;
    data['share_url'] = this.shareUrl;
    data['price'] = this.price;
    data['order'] = this.order;
    data['desc'] = this.desc;
    data['balance'] = this.balance;
    data['duration'] = this.duration;
    data['target'] = this.target;
    data['will_replace'] = this.willReplace;
    data['type'] = this.type;
    return data;
  }
}

class Packages {
  int id;
  String title;
  String thumbnail;
  String url;
  String shareUrl;
  String price;
  int order;
  String desc;
  String balance;
  int duration;
  String target;
  int willReplace;
  String type;

  Packages(
      {this.id,
      this.title,
      this.thumbnail,
      this.url,
      this.shareUrl,
      this.price,
      this.order,
      this.desc,
      this.balance,
      this.duration,
      this.target,
      this.willReplace,
      this.type});

  Packages.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    thumbnail = json['thumbnail'];
    url = json['url'];
    shareUrl = json['share_url'];
    price = json['price'].toString();
    order = json['order'];
    desc = json['desc'];
    balance = json['balance'];
    duration = json['duration'];
    target = json['target'];
    willReplace = json['will_replace'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['thumbnail'] = this.thumbnail;
    data['url'] = this.url;
    data['share_url'] = this.shareUrl;
    data['price'] = this.price;
    data['order'] = this.order;
    data['desc'] = this.desc;
    data['balance'] = this.balance;
    data['duration'] = this.duration;
    data['target'] = this.target;
    data['will_replace'] = this.willReplace;
    data['type'] = this.type;
    return data;
  }
}

class Devices {
  String deviceSn;
  String name;
  String desc;
  String logo;
  String descImage;
  String linkType;
  String deviceId;
  int userDeviceId;
  String url;
  String deviceNo;
  int hasSameCategory;

  Devices(
      {this.deviceSn,
      this.name,
      this.desc,
      this.logo,
      this.descImage,
      this.linkType,
      this.deviceId,
      this.userDeviceId,
      this.url,
      this.deviceNo,
      this.hasSameCategory});

  Devices.fromJson(Map<String, dynamic> json) {
    deviceSn = json['device_sn'];
    name = json['name'];
    desc = json['desc'];
    logo = json['logo'];
    descImage = json['desc_image'];
    linkType = json['link_type'];
    deviceId = json['device_id'];
    userDeviceId = json['user_device_id'];
    url = json['url'];
    deviceNo = json['device_no'];
    hasSameCategory = json['has_same_category'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['device_sn'] = this.deviceSn;
    data['name'] = this.name;
    data['desc'] = this.desc;
    data['logo'] = this.logo;
    data['desc_image'] = this.descImage;
    data['link_type'] = this.linkType;
    data['device_id'] = this.deviceId;
    data['user_device_id'] = this.userDeviceId;
    data['url'] = this.url;
    data['device_no'] = this.deviceNo;
    data['has_same_category'] = this.hasSameCategory;
    return data;
  }
}

class Diagnosis {
  String title;
  String desc;
  String thumbnail;
  String url;
  List<String> nonWord;

  Diagnosis({this.title, this.desc, this.thumbnail, this.url, this.nonWord});

  Diagnosis.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    desc = json['desc'];
    thumbnail = json['thumbnail'];
    url = json['url'];
    nonWord = json['non_word'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['desc'] = this.desc;
    data['thumbnail'] = this.thumbnail;
    data['url'] = this.url;
    data['non_word'] = this.nonWord;
    return data;
  }
}

class Qscc {
  String title;
  String desc;
  String thumbnail;
  String url;

  Qscc({this.title, this.desc, this.thumbnail, this.url});

  Qscc.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    desc = json['desc'];
    thumbnail = json['thumbnail'];
    url = json['url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['desc'] = this.desc;
    data['thumbnail'] = this.thumbnail;
    data['url'] = this.url;
    return data;
  }
}
